package com.chzc.fm.duotin.bean.home;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/6/27.
 */
public class LatestCommentsBean {


    /**
     * total_num : 0
     */

    private PageBean page;
    /**
     * page : {"total_num":0}
     * data_list : null
     */

    private List<LastCommandDataList> data_list;

    public static LatestCommentsBean objectFromData(String str) {

        return new Gson().fromJson(str, LatestCommentsBean.class);
    }

    public static List<LatestCommentsBean> arrayLatestCommentsBeanFromData(String str) {

        Type listType = new TypeToken<ArrayList<LatestCommentsBean>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public PageBean getPage() {
        return page;
    }

    public void setPage(PageBean page) {
        this.page = page;
    }

    public List<LastCommandDataList> getData_list() {
        return data_list;
    }

    public void setData_list(List<LastCommandDataList> data_list) {
        this.data_list = data_list;
    }

    public static class PageBean {
        private int total_num;

        public static PageBean objectFromData(String str) {

            return new Gson().fromJson(str, PageBean.class);
        }

        public static List<PageBean> arrayPageBeanFromData(String str) {

            Type listType = new TypeToken<ArrayList<PageBean>>() {
            }.getType();

            return new Gson().fromJson(str, listType);
        }

        public int getTotal_num() {
            return total_num;
        }

        public void setTotal_num(int total_num) {
            this.total_num = total_num;
        }
    }
}
